%% Author: 77
%% Created: 2011-7-5
%% Description: TODO: Add description to get_node_status_cmd
-module(get_node_status_cmd).
-date("2011.08.01").

%%
%% Include files
%%
-include("meta_schema.hrl").

%%
%% Exported Functions
%%
-export([handle/3]).

%%
%% API Functions
%%
handle(Content, From, State) ->
	io:format("get node status cmd handle info ~p ~p ~p ~p ~n", [?MODULE, Content, From, State]),
	case check_parm(Content) of
		true ->
			io:format("get node status check pass~n"),
			{Node} = Content,
			io:format("request node ~p status~n", [Node]),
			case meta_data_ops:get_node_status(Node) of
				false ->
					io:format("get node status false!~n"),
					gen_server:reply(From, {error, get_node_satus_false}),
					false;
				Results ->
					io:format("get node ~p status is:~p~n", [Node, Results]),
					gen_server:reply(From, ok),
					ok
			end;
		false ->
			io:foramt("check parameter error~n"),
			gen_server:reply(From, {error, err_parm}),
			false
	end.


%%
%% Local Functions
%%
check_parm(Content) ->
	true.
